package com.bailan.sys.controller;

import com.bailan.common.util.DataGridView;
import com.bailan.common.util.ResultObj;
import com.bailan.sys.service.LogInfoService;
import com.bailan.sys.vo.LogInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Controller
@RequestMapping("logInfo")
public class LogInfoController {
    /**
     * 日志管理控制
     */
        @Autowired
        private LogInfoService logInfoService;

        /**
         * 加载日志列表返DataGridView
         * @param logInfoVo
         * @return
         */
        @RequestMapping("loadAllLogInfo")
        public DataGridView loadAllLogInfo(LogInfoVo logInfoVo){
            return this.logInfoService.queryAllLogInfo(logInfoVo);
        }
    @RequestMapping("deleteLogInfo")
    public ResultObj deleteLogInfo(Integer id){
        try {
            this.logInfoService.deleteLogInfo(id);
            return ResultObj.DELETE_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return ResultObj.DELETE_ERROR;
        }
    }
    @RequestMapping("deleteBatchLogInfo")
    public ResultObj deleteBatchLogInfo(LogInfoVo logInfoVo){
        try {
            this.logInfoService.deleteBatchLogInfo(logInfoVo.getIds());
            return ResultObj.DELETE_SUCCESS;
        } catch (Exception e) {
            e.printStackTrace();
            return ResultObj.DELETE_ERROR;
        }
    }

}
